#the plug-and-play interface to dbframework


#how to plug admin controls into main panel

def admin_link():
    """this method return info about admin link exported from application
    app can export max one link 'cose of problem in overrun of tool bar"""
    link_info =  { "name" : "stats",
                   "title":"stats",
                   "url":"/plugin/stat",
                   "icon": "/media/admin/icon-menu-stats.png" }
    return link_info

#function defining show method for elements need for each model you like to render
# like:

def stat_short():
    return "stat_short.html"

# just return all views defined into application
def get_views():
    list_of_views = ["Stat"]
    return list_of_views

# resolve template for rendering a specific view
def selected_view(viewtype):
    if viewtype == 'Stat':
        return "stats.html"

def map_elem_into_section(etype):
    if etype == "Stat":
        return "stat:Stat"

def get_model(name):
    if name == "Stat":
        return stat.Stat
